package com.yunxin.yundubbo.util;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;

public class RequestContext {
    private static final ConcurrentHashMap<String, CompletableFuture<String>> REQUEST_MAP = new ConcurrentHashMap<>();

    public static void set(String requestId, CompletableFuture<String> future) {
        REQUEST_MAP.put(requestId, future);
    }

    public static CompletableFuture<String> remove(String requestId) {
        return REQUEST_MAP.remove(requestId);
    }
}
